/**
 * Created by chenyong on 2015/7/16.
 */

var passport = require('passport');
var FacebookStrategy = require('passport-facebook').Strategy;

exports.setup = function ( config) {
  passport.use(new FacebookStrategy({
      clientID: config.facebook.clientID,
      clientSecret: config.facebook.clientSecret,
      callbackURL: config.facebook.callbackURL
    },
    function(accessToken, refreshToken, profile, done) {
      //将用户信息写入数据库
      return done(null, profile);
    }
  ));
};